Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental migration support for POSIX #441

Merged
merged 16 commits into from
Jan 14, 2025

Conversation

AlCutter
Copy link
Collaborator

This PR adds experimental migration support for migrating into POSIX logs.

Towards #436

@AlCutter AlCutter force-pushed the posix_migrate branch 6 times, most recently from 61fc3f0 to 0980818 Compare January 10, 2025 18:42
@AlCutter AlCutter marked this pull request as ready for review January 10, 2025 18:42
@AlCutter AlCutter requested a review from mhutchinson January 10, 2025 18:42
@AlCutter AlCutter added the enhancement New feature or request label Jan 10, 2025
@AlCutter AlCutter added this to the beta milestone Jan 10, 2025
type RangeInfo struct {
// StartIndex is the index of the first entry bundle the range touches.
StartIndex uint64
// StartPartial is non-zero if the bundle at StartIndex is expected to be partial.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something that this value references the first index into the bundle? i.e. (256 * StartIndex) + StartPartial is the index that this starts from?

At the moment the docs suggest this StartPartial is basically a boolean in disguise.

@AlCutter AlCutter force-pushed the posix_migrate branch 2 times, most recently from 3bff6b5 to 44ee4f6 Compare January 14, 2025 10:44
@AlCutter AlCutter requested a review from a team as a code owner January 14, 2025 10:44
@AlCutter AlCutter requested a review from roger2hk January 14, 2025 10:44
@AlCutter AlCutter force-pushed the posix_migrate branch 5 times, most recently from 5f9abb3 to efdee12 Compare January 14, 2025 10:52
Copy link
Contributor

@mhutchinson mhutchinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still reviewing, but here's some comments.

api/layout/paths_test.go Outdated Show resolved Hide resolved
todo chan bundle

// bundlesToMigrate is the total number of entry bundles which need to be copied.
bundlesToMigrate uint64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to this field looks racy

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - changed the approach

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't even need to be a field now. Can just be a local variable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

api/layout/paths.go Outdated Show resolved Hide resolved
Copy link
Contributor

@roger2hk roger2hk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a README.md in cmd/experimental/migrate would be helpful to tell how to try this migration tool.

@AlCutter
Copy link
Collaborator Author

Adding a README.md in cmd/experimental/migrate would be helpful to tell how to try this migration tool.

Good call, but I'll add that in a follow up soon, this PR is already a bit large...

func Migrate(ctx context.Context, numWorkers int, sourceSize uint64, sourceRoot []byte, getEntries client.EntryBundleFetcherFunc, storage MigrationStorage) error {
klog.Infof("Starting migration; source size %d root %x", sourceSize, sourceRoot)

// TODO store state & resume
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naked TODO considered harmful. Before submit, can we have this fixed, a name attached, or an issue created and linked?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the TODO - currently if the job crashes and is restarted, it'll pick up from the size of the locally integrated tree. That's likely good enough for now.

@AlCutter AlCutter mentioned this pull request Jan 14, 2025
@AlCutter AlCutter merged commit c8604b6 into transparency-dev:main Jan 14, 2025
15 checks passed
@AlCutter AlCutter deleted the posix_migrate branch January 14, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants